/* Ejercicio 4.32
   ejer4_32 */
#include <stdio.h>

/* function main begins program execution */
int main( void )
{
   int n;
   int i, j, k;

   printf( "Enter a odd integer: " );
   scanf( "%d", &n );

   /* Validates input */
   while ( n % 2 == 0 ) {
      printf( "Error. Enter a odd integer: " );
      scanf( "%d", &n );
   }

   k = 1;
   for ( i = n - 1; i >= 0; i-- ) {

      for ( j = 1; j <= i; j++ ) {
         printf( " " );
      }

      for ( j = 1; j <= k; j++ ) {
         printf( "*" );
      }

      k += 2;
      printf( "\n" );
   }

   k -= 4;

   for ( i = 1; i < n; i++ ) {

      for ( j = 1; j <= i; j++ ) {
         printf( " " );
      }

      for ( j = 1; j <= k; j++ ) {
         printf( "*" );
      }

      k -= 2;
      printf( "\n" );
   }

	return 0; /* indicate that program ended successfully */
} /* end function main */
